package LuoGu;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class P2089 {
    public static boolean progress2089(int n,int i,int[] a,long sum,ArrayList<int[]> list){
        if(sum>n){
            return false;
        }
        if(i==11){
            if(sum==n){
                int[] aTmp2=new int[11];
                for (int i1 = 0; i1 < 11; i1++) {
                    aTmp2[i1]=a[i1];
                }
                list.add(aTmp2);
                return true;
            }else{
                return false;
            }
        }
        int[] aTmp=new int[11];
        for (int i1 = 0; i1 < 11; i1++) {
            aTmp[i1]=a[i1];
        }
        boolean tmp=false;
        aTmp[i]=1;
        tmp=tmp|progress2089(n,i+1,aTmp,sum+aTmp[i],list);
        aTmp[i]=2;
        tmp=tmp|progress2089(n,i+1,aTmp,sum+aTmp[i],list);
        aTmp[i]=3;
        tmp=tmp|progress2089(n,i+1,aTmp,sum+aTmp[i],list);
        return tmp;
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] a=new int[11];
        ArrayList<int[]> list=new ArrayList<>();
        boolean tmp=progress2089(n,1,a,0,list);
        if(!tmp){
            System.out.println(0);
        }else{
            System.out.println(list.size());
            for (int i = 0; i < list.size(); i++) {
                int[] tmpArr=list.get(i);
                for (int i1 = 1; i1 <=10; i1++) {
                    System.out.print(tmpArr[i1]+" ");
                }
                System.out.println();
            }
        }

    }
}
